home *** CD-ROM | disk | FTP | other *** search
/ Hardcore Visual Basic 5.0 (2nd Edition) / Hardcore Visual Basic 5.0 - Second Edition (1997)(Microsoft Press).iso / Code / Goodies / NAMESP~1 / DDTREE.FR_ / DDTREE.FR
Text File  |  1997-06-04  |  6KB  |  183 lines

  1. VERSION 5.00
  2. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.1#0"; "COMCTL32.OCX"
  3. Object = "{688EB628-7DA2-11D0-95F0-0020AF07755A}#1.1#0"; "awddtree.ocx"
  4. Begin VB.MDIForm mdiDemo 
  5.    BackColor       =   &H8000000C&
  6.    Caption         =   "Acuteware DropDownTree Control Demo"
  7.    ClientHeight    =   6840
  8.    ClientLeft      =   60
  9.    ClientTop       =   345
  10.    ClientWidth     =   7950
  11.    Icon            =   "DDTree.frx":0000
  12.    LinkTopic       =   "MDIForm1"
  13.    LockControls    =   -1  'True
  14.    Begin VB.PictureBox picTitle 
  15.       Align           =   1  'Align Top
  16.       BorderStyle     =   0  'None
  17.       Height          =   1335
  18.       Left            =   0
  19.       ScaleHeight     =   1335
  20.       ScaleWidth      =   7950
  21.       TabIndex        =   0
  22.       Top             =   0
  23.       Width           =   7950
  24.       Begin AWDDTREE.DDTree ddtSelect 
  25.          Height          =   330
  26.          Left            =   840
  27.          TabIndex        =   1
  28.          Top             =   900
  29.          Width           =   6915
  30.          _ExtentX        =   12197
  31.          _ExtentY        =   582
  32.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  33.             Name            =   "MS Sans Serif"
  34.             Size            =   8.25
  35.             Charset         =   0
  36.             Weight          =   400
  37.             Underline       =   0   'False
  38.             Italic          =   0   'False
  39.             Strikethrough   =   0   'False
  40.          EndProperty
  41.       End
  42.       Begin VB.Label lblMenu 
  43.          Caption         =   "&Menu:"
  44.          Height          =   195
  45.          Left            =   180
  46.          TabIndex        =   3
  47.          Top             =   960
  48.          Width           =   555
  49.       End
  50.       Begin ComctlLib.ImageList imlMenu 
  51.          Left            =   6540
  52.          Top             =   900
  53.          _ExtentX        =   1005
  54.          _ExtentY        =   1005
  55.          BackColor       =   -2147483643
  56.          ImageWidth      =   16
  57.          ImageHeight     =   16
  58.          MaskColor       =   128
  59.          _Version        =   327680
  60.          BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7} 
  61.             NumListImages   =   3
  62.             BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  63.                Picture         =   "DDTree.frx":000C
  64.                Key             =   "Info"
  65.             EndProperty
  66.             BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  67.                Picture         =   "DDTree.frx":011E
  68.                Key             =   "Exit"
  69.             EndProperty
  70.             BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  71.                Picture         =   "DDTree.frx":0230
  72.                Key             =   "Sample"
  73.             EndProperty
  74.          EndProperty
  75.       End
  76.       Begin VB.Label lblTitle 
  77.          Alignment       =   2  'Center
  78.          BackColor       =   &H00000000&
  79.          BorderStyle     =   1  'Fixed Single
  80.          Caption         =   "Acuteware DropDownTree"
  81.          BeginProperty Font 
  82.             Name            =   "Arial"
  83.             Size            =   24
  84.             Charset         =   0
  85.             Weight          =   700
  86.             Underline       =   0   'False
  87.             Italic          =   -1  'True
  88.             Strikethrough   =   0   'False
  89.          EndProperty
  90.          ForeColor       =   &H00FFFFFF&
  91.          Height          =   675
  92.          Left            =   180
  93.          TabIndex        =   2
  94.          Top             =   120
  95.          Width           =   7575
  96.       End
  97.    End
  98. End
  99. Attribute VB_Name = "mdiDemo"
  100. Attribute VB_GlobalNameSpace = False
  101. Attribute VB_Creatable = False
  102. Attribute VB_PredeclaredId = True
  103. Attribute VB_Exposed = False
  104. Option Explicit
  105.  
  106. Private Sub ddtSelect_Click()
  107.     Call ShowForm(ddtSelect.SelectedItem.Key)
  108. End Sub
  109.  
  110. Private Sub ShowForm(sName$)
  111.     Dim frm As Form
  112.     Dim frmPrev As Form
  113.  
  114.     Select Case sName
  115.     Case "frmIntro": Set frm = frmIntro
  116.     Case "frmSample1": Set frm = frmSample1
  117.     Case "frmSample2": Set frm = frmSample2
  118.     Case "frmSample3": Set frm = frmSample3
  119.     Case "frmSample4": Set frm = frmSample4
  120.     Case "frmSample5": Set frm = frmSample5
  121.     Case "Exit"
  122.         Unload Me
  123.         Exit Sub
  124.     End Select
  125.     If frm Is Nothing Then Exit Sub
  126.     
  127. '    If Not Me.ActiveForm Is Nothing Then
  128. '        Unload Me.ActiveForm
  129. '    End If
  130.     Screen.MousePointer = vbHourglass
  131.     frm.Show
  132.     frm.ZOrder
  133.     Screen.MousePointer = vbDefault
  134. End Sub
  135.  
  136. Private Sub MDIForm_Load()
  137.     Me.Move 0, 0
  138.     Set ddtSelect.ImageList = imlMenu
  139.     
  140.     With ddtSelect.Nodes
  141.         With .Add(, , "frmIntro", "Introduction", "Info")
  142.             .Expanded = True
  143.         End With
  144.         Call .Add("frmIntro", tvwChild, "frmSample1", "Sample 1: Add Images to DropDown Lists", "Sample")
  145.         Call .Add("frmIntro", tvwChild, "frmSample2", "Sample 2: Group Items", "Sample")
  146.         Call .Add("frmIntro", tvwChild, "frmSample3", "Sample 3: ModeDrive;  A DriveListBox with New Look", "Sample")
  147.         Call .Add("frmIntro", tvwChild, "frmSample4", "Sample 4: ModePath;  Browsing Drives and Parent Directories", "Sample")
  148.         Call .Add("frmIntro", tvwChild, "frmSample5", "Sample 5: ModeNameSpace;  The Explorer DropDown", "Sample")
  149.         Call .Add(, , "Exit", "Exit this demo", "Exit")
  150.     End With
  151.     Set ddtSelect.SelectedItem = ddtSelect.Nodes(1)
  152.     Call ShowForm("frmIntro")
  153.     ddtSelect.SetFocus
  154. End Sub
  155.  
  156. Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  157.     ddtSelect.ShowAbout
  158. End Sub
  159.  
  160. Private Sub MDIForm_Resize()
  161.     Static xbSizing As Boolean
  162.         
  163.     If xbSizing Then Exit Sub
  164.     xbSizing = True
  165.         On Error Resume Next
  166.         If Height <> 7245 Then Height = 7245
  167.         If Width <> 8070 Then Width = 8070
  168.     xbSizing = False
  169. End Sub
  170.  
  171. Private Sub picTitle_Resize()
  172.     Dim y As Single
  173.     Dim w As Single
  174.     
  175.     y = picTitle.ScaleWidth - 180
  176.     w = y - lblTitle.Left
  177.     If w < 0 Then w = 0
  178.     lblTitle.Width = w
  179.     w = y - ddtSelect.Left
  180.     If w < 0 Then w = 0
  181.     ddtSelect.Width = w
  182. End Sub
  183.